package com.ufgov.smartclient.component.table;

import javax.swing.JTable;

import jxl.write.WritableCellFormat;
import jxl.write.WriteException;

/**
 * <p>Title: com.ufgov.smartclient.component</p>
 * <p>Description: excel单元格格式提供器</p>
 * <p>Copyright: Copyright 2010 ufgov, Inc.</p>
 * <p>Company: ufgov</p>
 * <p>创建时间: Oct 15, 2010</p>
 * @author 刘永伟(manlge)
 * @version 1.0
 */
public interface CellFormatPrivoder {

  /**
   * @return 除了表头、数据、合计行外默认使用的CellFormat，如：在{@link JLayerTable}中导出合并单元格
   * @throws WriteException
   */
  public WritableCellFormat getDefaultCellFormat() throws WriteException;

  /**
   * @return 导出时表头使用的CellFormat
   */
  public WritableCellFormat getHeaderCellFormatAt(JTable table)
    throws WriteException;

  /**
   * @param rowIndex 行索引
   * @param columnIndex 列索引
   * @return 导出数据时使用的CellFormat
   */
  public WritableCellFormat getDataCellFormatAt(int rowIndex, int columnIndex,
    JTable table) throws WriteException;

  /**
   * @param columnIndex 列索引
   * @return 导出合计行时使用的CellFormat
   */
  public WritableCellFormat getTotalCellFormatAt(int columnIndex, JTable table)
    throws WriteException;

}
